// 请求异常类
class HttpException implements Exception {
  final String? _message;
  String get message => _message ?? this.runtimeType.toString();
  final int? _code;
  int get code => _code ?? -1;
  HttpException([this._message, this._code]);
  String toString() {
    return "code: $code--message= $message";
  }
}

// 客户端请求错误
class BadRequestException extends HttpException {
  BadRequestException({String? message, int? code}) : super(message, code);
}
// 响应错误
class BadServerException extends HttpException {
  BadServerException({String? message, int? code}) : super(message, code);
}
// 未知错误
class UnknownException extends HttpException {
  UnknownException([String? message]) : super(message);
}
// 
class CancelException extends HttpException {
  CancelException([String? message]) : super(message);
}
// 网络异常
class NetworkException extends HttpException {
  NetworkException({String? message, int? code}) : super(message, code);
}
// 401
class UnauthorisedException extends HttpException {
  UnauthorisedException({String? message, int? code = 401}) : super(message);
}
// 
class BadResponseException extends HttpException {
  dynamic? data;
  BadResponseException([this.data]) : super();
}